export function randint(a, b){
  if (b) {
    b = b + 1
    return Math.floor(a + Math.random() * (b - a))
  }else if(a){
    a = a + 1
    return Math.floor(Math.random() * a)
  }else{
    console.error('randint: 错误的函数调用')
  }
}

export function contain(num, a, b){
  if(num < a) return a
  if(num > b) return b
  return num
}

